<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8" %>
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="java.util.*" %>
<%@ page import="javax.servlet.jsp.*" %>
<%@ page import="javax.servlet.jsp.jstl.core.*" %>
<%@ page import="org.apache.commons.lang.*" %>
<%@ page import="org.gbif.portal.web.filter.*" %>
<%@ page import="org.apache.taglibs.string.util.*" %>
<c:set var="viewName" scope="request"><tiles:getAsString name="viewName"/></c:set>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">		
		<title>
				<c:set var="title"><tiles:getAsString name="title"/></c:set>
				<c:set var="searchTitle"><tiles:getAsString name="searchTitle"/></c:set>
				<spring:message code="${searchTitle}" text=""/>
				<tiles:insert name="subtitle"/>
				
				<c:set var="title" scope="request">
						<c:set var="searchTitle"><tiles:getAsString name="searchTitle"/></c:set>
						<spring:message code="${searchTitle}" text=""/>
						<tiles:insert name="subtitle" flush="false"/>
				</c:set>				
					- 				
				<spring:message code="${title}" text=""/>
		</title>
		<tiles:insert name="headcontent"/>
	</head>
	<body>
	  <div id="skipNav">
			<ul title="Accessibility options">
	  		<li><a href="#mainContent" accesskey="C">Skip to Content</a></li>
	  		<li><a href="#sidebar" accesskey="S">Skip to Sidebar</a></li>
			</ul> 
	  </div><!-- End skipNav -->
		<div id="cocoon">
			<div id="container">	
				<tiles:insert name="header"/>
				<tiles:insert name="topmenu"/>
				<div id="content">
				
					<div id="contentExplorer">
						<div class="rowExplorer">
							<div class="leftColumn">
							
							<div id="map" style="height:800px; width:800px;  margin-top:50px;"></div>
<script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false"></script>
<script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script>

<script>

	var lon = -74;
	var lat = 5;
	var zoom = 5;
	
	var map;

	function init() {
		map = new OpenLayers.Map('map', {
            controls: [
                new OpenLayers.Control.Navigation(),
                new OpenLayers.Control.LayerSwitcher(), 
                new OpenLayers.Control.PanZoomBar(),
                new OpenLayers.Control.MousePosition()]
        });
	    map.addControl(new OpenLayers.Control.LayerSwitcher());
	    
	    // the SATELLITE layer has all 22 zoom level, so we add it first to
	    // become the internal base layer that determines the zoom levels of the
	    // map.
	    var gsat = new OpenLayers.Layer.Google(
	        "Google Satellite",
	        {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22, visibility: false}
	    );
	    var gphy = new OpenLayers.Layer.Google(
	        "Google Physical",
	        {type: google.maps.MapTypeId.TERRAIN, numZoomLevels: 22, visibility: true}
	    );
	    var gmap = new OpenLayers.Layer.Google(
	        "Google Streets", // the default
	        {numZoomLevels: 22, visibility: false}
	    );
	    var ghyb = new OpenLayers.Layer.Google(
	        "Google Hybrid",
	        {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 22, visibility: false}
	    );

	    map.addLayers([gphy, gsat, gmap, ghyb]);

	    // Google.v3 uses EPSG:900913 as projection, so we have to
	    // transform our coordinates
	    map.setCenter(new OpenLayers.LonLat(-74.4, 4.59).transform(
	        new OpenLayers.Projection("EPSG:4326"),
	        map.getProjectionObject()
	    ), 5);
	    
	}
        
        init();
</script>
							
							</div>
							<din class="rightColumn">
							<%//For the 2 columns %>
					<%
							List<FilterDTO> filters = (List<FilterDTO>) request.getAttribute("filters");
							CriteriaDTO criteriaDTO = (CriteriaDTO) request.getAttribute("criteria");		
							List<CriterionDTO> criteria = criteriaDTO.getCriteria();
							pageContext.setAttribute("criteria", criteria);		 
					%>
							<table id="filtersAndEditor">
						<tr>
							<td id="filterEditorPane">	
								<tiles:insert name="filterEditor"/>
							</td>
							</tr>
							<tr>						
							<td id="constructedFiltersPane">
								<c:set var="filterAction" scope="request"><tiles:getAsString name="filterAction"/></c:set>
								<div id="constructedFilters">
									<c:choose>
										<c:when test="${fn:length(criteria)==0}">									
											<tiles:insert name="filterHelp"/>
										</c:when>
										<c:otherwise>							
											<tiles:insert name="constructedFilter"/>											
										</c:otherwise>
									</c:choose>					
									<tiles:insert name="warnings"/>				
								</div><!-- End constructedFilters -->					
							</td>
						</tr>
					</table><!-- filtersAndEditor -->
					<c:if test="${fn:length(criteria)!=0}">
						<div id="actionsAndResults">
							<tiles:insert name="actions"/>
							<tiles:insert name="results"/>														
						</div><!-- End actionsAndResults -->
					</c:if>
							</div>
						</div>
					</div>
					<tiles:insert page="/WEB-INF/jsp/filters/filterArrays.jsp"/>
					
					<div id="filtersContainer">
					
	
					</div><!-- End filtersContainer -->
					<tiles:insert name="breadcrumbs"/>				
				</div><!--End content -->
				<tiles:insert name="footer"/>
			</div><!-- End container-->
		</div><!-- End cocoon-->		
	</body>
</html>